<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>
    Getting Roundup working on PAW : Forums : PythonAnywhere
</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="Forums : PythonAnywhere">
        <meta name="author" content="PythonAnywhere LLP">
        <meta name="google-site-verification" content="O4UxDrfcHjC44jybs2vajc1GgRkTKCTRgVzeV6I9V14" />

        <!-- Le styles -->
        <link href="/static/bootstrap/css/bootstrap.css" rel="stylesheet">
        <link href="/static/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
        <link href="/static/anywhere/styles/bootstrap_base.css" rel="stylesheet">
        
    
    <link rel="stylesheet" href="/static/anywhere/styles/forums.css" type="text/css" media="screen" charset="utf-8" />

    <link rel="stylesheet" href="/static/pygments/style.css" type="text/css" media="screen" charset="utf-8" />

        <link rel="stylesheet" href="/static/jquery/jquery-ui-1.8.11.custom.css" type="text/css" media="screen" charset="utf-8" />
        
    
    <link rel="alternate" type="application/rss+xml" title="RSS" href="/forums/topic/797/rss" />

        <style type="text/css">
            body {
                height: auto;
            }
        </style>
        <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
        <!--[if lt IE 9]>
        <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->

        <!-- Le fav and touch icons -->
        <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
        <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
        <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
    </head>

     <body>
        <div class="navbar navbar-fixed-top">
            <div class="navbar-inner">
                <div id="id_internal_nav_bar_container" class="container">
                    <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    </a>
                    <a class="brand" href="/"><img id="id_logo" src="/static/anywhere/images/logo-234x35.png" height="35" title="PythonAnywhere logo" alt="PythonAnywhere logo" /></a>
                    <div class="nav-collapse">
                        <ul id="id_header_links" class="nav">
                            <li><a id="id_feedback_link" class='feedback_link' href="">Send feedback</a></li>
                            <li><a id="id_forums_link" href="/forums/">Forums</a></li>
                            <li><a href="/wiki/" id="id_help_link">Help</a></li>
                            <li><a href="http://blog.pythonanywhere.com/" id="id_blog_link">Blog</a></li>
                            
                            
                                <li><a style="font-weight: bold;" href="/pricing/" id="id_pricing_link">Pricing & signup</a></li>
                                <li><a href="/login/?next=/forums/topic/797/" id="id_login_link">Log in</a></li>
                            
                        </ul>
                    </div>
                </div>
            </div>
        </div>

        <div class="top-container" id="id_dummy"></div>

        

        
    
    <div class="container">
        <div class="row">
            <div class="span8 offset3">
                <h1>PythonAnywhere Forums</h1>
            </div>
        </div>



    <div class="row">
        <div class="span8 offset3">
            <p>
                <a href="/forums/start_topic/" id="id_start_new_topic">Start a new topic</a> |
                <a href="/forums/">Back to all topics</a> |
                <a href="/forums/topic/797/rss">This topic's RSS</a>
            </p>
        </div>
    </div>
    <div class="row">
        <div class="span8 offset3 topic">
            <h2>Getting Roundup working on PAW</h2>
        </div>
    </div>

    
        <div class="row">
            <div id="id_post_5655" class="span8 offset3 post">
                <div class="row">
                    <div id="id_post_5655_content_text" class="span8">
                        <p>Hi All,</p>
<p>I have been trying to find out how to get various wsgi capable applications embedded into a site using pythonpaste, and so far not found the way to do it.</p>
<p>My current attempt is to get roundup happy.</p>
<p>Granted I am not intimate with WSGI, but if someone could point me in the right place to get started with this, I'd be much obliged.</p>
<p>Cheers</p>
<p>Craig</p>
                    </div>
                </div>
                <div class="row">
                    <div class="span7 post_metadata">
                        <span id="id_post_5655_creator_details">
                            
                                
                                    <img src="/static/anywhere/images/star.gif" alt="Beloved premium user" title="Beloved premium user"/>
                                
                            
                            barnsey
                            |
                            36
                            posts
                            |
                            
                        </span>
                        <span id="id_post_5655_created_date">
                            July 26, 2013, 10:08 p.m.
                        </span>
                        |
                        <a href="https://www.pythonanywhere.com/forums/topic/797/#id_post_5655">permalink</a>
                    </div>
                    <div class="span1">
                        
                    </div>
                </div>
            </div>
        </div>
    
        <div class="row">
            <div id="id_post_5659" class="span8 offset3 post">
                <div class="row">
                    <div id="id_post_5659_content_text" class="span8">
                        <p>Hey barnsey, </p>
<p>Is roundup a WSGI application? It looks like it might be. If so, you just need to create a PythonAnywhere web app. Edit the wsgi.py file for it, load roundup, and create an <code>application</code> object for our WSGI server to use. This <a href="http://stackoverflow.com/questions/12408871/setup-roundup-with-wsgi-and-apache">stackoverflow answer</a> says it looks something like this: </p>
<div class="codehilite"><pre><span class="kn">from</span> <span class="nn">roundup.cgi.wsgi_handler</span> <span class="kn">import</span> <span class="n">RequestDispatcher</span>
<span class="n">tracker_home</span> <span class="o">=</span> <span class="s">&#39;/home/barnsey/roundup/support&#39;</span> 
<span class="n">application</span> <span class="o">=</span> <span class="n">RequestDispatcher</span><span class="p">(</span><span class="n">tracker_home</span><span class="p">)</span>
</pre></div>
                    </div>
                </div>
                <div class="row">
                    <div class="span7 post_metadata">
                        <span id="id_post_5659_creator_details">
                            
                                <img src="/static/anywhere/images/staff.png" alt="Staff" title="Staff"/>
                            
                            hansel
                            |
                            435
                            posts
                            |
                            
                                PythonAnywhere staff
                                |
                            
                        </span>
                        <span id="id_post_5659_created_date">
                            July 27, 2013, 9:02 a.m.
                        </span>
                        |
                        <a href="https://www.pythonanywhere.com/forums/topic/797/#id_post_5659">permalink</a>
                    </div>
                    <div class="span1">
                        
                    </div>
                </div>
            </div>
        </div>
    
        <div class="row">
            <div id="id_post_5667" class="span8 offset3 post">
                <div class="row">
                    <div id="id_post_5667_content_text" class="span8">
                        <p>Hi hansel,</p>
<p>Thanks for getting back, yes, it is wsgi capable, and that part is documented in the roundup docs.  </p>
<p>What I am doing is use paste to create a composite application embedding roundup in my site.</p>
<p>I have managed to get this working now as follows.</p>
<p>I create a module that will provide the application in wsgi_apps.py</p>
<div class="codehilite"><pre><span class="kn">from</span> <span class="nn">roundup.cgi.wsgi_handler</span> <span class="kn">import</span> <span class="n">RequestDispatcher</span>

<span class="n">roundup_app</span> <span class="o">=</span> <span class="n">RequestDispatcher</span><span class="p">(</span><span class="s">&#39;/home/barnsey/sites/helpdesk/&#39;</span><span class="p">)</span>

<span class="k">def</span> <span class="nf">roundup_factory</span><span class="p">(</span><span class="n">global_config</span><span class="p">,</span> <span class="o">**</span><span class="n">local_config</span><span class="p">):</span>
    <span class="k">return</span> <span class="n">roundup_app</span>
</pre></div>


<p>This needs to be in your PYTHONPATH</p>
<p>in my wsgi.py file I have</p>
<div class="codehilite"><pre><span class="kn">from</span> <span class="nn">paste.deploy</span> <span class="kn">import</span> <span class="n">loadapp</span>
<span class="n">application</span> <span class="o">=</span> <span class="n">loadapp</span><span class="p">(</span><span class="s">&#39;config:/home/barnsey/sites/test.ini&#39;</span><span class="p">)</span>
</pre></div>


<p>and finally /home/barnsey/sites/test.ini</p>
<div class="codehilite"><pre><span class="k">[composite:main]</span>
<span class="na">use</span> <span class="o">=</span> <span class="s">egg:Paste#urlmap</span>
<span class="na">/</span> <span class="o">=</span> <span class="s">home</span>
<span class="na">/helpdesk</span> <span class="o">=</span> <span class="s">roundup</span>

<span class="k">[app:home]</span>
<span class="na">use</span> <span class="o">=</span> <span class="s">egg:Paste#static</span>
<span class="na">document_root</span> <span class="o">=</span> <span class="s">%(here)s/www/output</span>

<span class="k">[app:roundup]</span>
<span class="na">paste.app_factory</span> <span class="o">=</span> <span class="s">wsgi_apps:roundup_factory</span>
</pre></div>


<p>Using sqlite it seems happy, now to sort out postgresql, unfortunately the initialisation tool for roundup wants to create a database from scratch, and PAW wont have it...</p>
                    </div>
                </div>
                <div class="row">
                    <div class="span7 post_metadata">
                        <span id="id_post_5667_creator_details">
                            
                                
                                    <img src="/static/anywhere/images/star.gif" alt="Beloved premium user" title="Beloved premium user"/>
                                
                            
                            barnsey
                            |
                            36
                            posts
                            |
                            
                        </span>
                        <span id="id_post_5667_created_date">
                            July 27, 2013, 10:25 p.m.
                        </span>
                        |
                        <a href="https://www.pythonanywhere.com/forums/topic/797/#id_post_5667">permalink</a>
                    </div>
                    <div class="span1">
                        
                    </div>
                </div>
            </div>
        </div>
    
        <div class="row">
            <div id="id_post_5668" class="span8 offset3 post">
                <div class="row">
                    <div id="id_post_5668_content_text" class="span8">
                        <p>I have exported the sqlite database and imported it to postgresql using roundup-admin.</p>
<p>Now on to Tryton ;D</p>
                    </div>
                </div>
                <div class="row">
                    <div class="span7 post_metadata">
                        <span id="id_post_5668_creator_details">
                            
                                
                                    <img src="/static/anywhere/images/star.gif" alt="Beloved premium user" title="Beloved premium user"/>
                                
                            
                            barnsey
                            |
                            36
                            posts
                            |
                            
                        </span>
                        <span id="id_post_5668_created_date">
                            July 27, 2013, 11:03 p.m.
                        </span>
                        |
                        <a href="https://www.pythonanywhere.com/forums/topic/797/#id_post_5668">permalink</a>
                    </div>
                    <div class="span1">
                        
                    </div>
                </div>
            </div>
        </div>
    
        <div class="row">
            <div id="id_post_5669" class="span8 offset3 post">
                <div class="row">
                    <div id="id_post_5669_content_text" class="span8">
                        <p>Glad you got it working Barnsey. And thanks for documenting it here as well. </p>
                    </div>
                </div>
                <div class="row">
                    <div class="span7 post_metadata">
                        <span id="id_post_5669_creator_details">
                            
                                <img src="/static/anywhere/images/staff.png" alt="Staff" title="Staff"/>
                            
                            hansel
                            |
                            435
                            posts
                            |
                            
                                PythonAnywhere staff
                                |
                            
                        </span>
                        <span id="id_post_5669_created_date">
                            July 28, 2013, 8:13 a.m.
                        </span>
                        |
                        <a href="https://www.pythonanywhere.com/forums/topic/797/#id_post_5669">permalink</a>
                    </div>
                    <div class="span1">
                        
                    </div>
                </div>
            </div>
        </div>
    

    




        <div id="id_footer" class="container">

            <footer id="id_copyright_div">
                <p>
                    Copyright &copy; 2013 PythonAnywhere LLP
                    &mdash;
                    <a href="/terms/">Terms</a>
                    &mdash;
                    <a href="/privacy/">Privacy</a><br/>
                    "Python" is a registered trademark of the Python Software Foundation.
                </p>
            </footer>

        </div>

        
        

        <div id="id_feedback_dialog" title="Help us improve" style="display:none">
    <div id="id_feedback_dialog_blurb_big" class="dialog_blurb_big">
        It's always a pleasure to hear from you!
    </div>
    <div id="id_feedback_dialog_blurb_small">
        Ask us a question, or tell us what you love or hate about PythonAnywhere.<br/>
        We'll get back to you over email ASAP.
    </div>
    <textarea id="id_feedback_dialog_text" rows="6"></textarea>
    <input id="id_feedback_dialog_email_address" type="text" class="default_prompt"/>
    <div id="id_feedback_dialog_error" class="pa_hidden">
        Sorry, there was an error connecting to the server. <br/>Please try again in a few moments...
    </div>
    <div class="dialog_buttons">
        <img id="id_feedback_dialog_spinner" src="/static/anywhere/images/spinner-small.gif" />
        <button class="btn btn-primary" id="id_feedback_dialog_ok_button">OK</button>
        <button class="btn" id="id_feedback_dialog_cancel_button">Cancel</button>
    </div>
</div>


        <!-- Le javascript
        ================================================== -->
        <!-- Placed at the end of the document so the pages load faster -->
        <script type="text/javascript" src="/static/jquery/jquery-1.7.1.min.js"></script>
        <script type="text/javascript" src="/static/jquery/jquery-ui-1.8.11.custom.min.js"></script>
        <script src="/static/bootstrap/js/bootstrap-transition.js"></script>
        <script src="/static/bootstrap/js/bootstrap-alert.js"></script>
        <script src="/static/bootstrap/js/bootstrap-modal.js"></script>
        <script src="/static/bootstrap/js/bootstrap-dropdown.js"></script>
        <script src="/static/bootstrap/js/bootstrap-scrollspy.js"></script>
        <script src="/static/bootstrap/js/bootstrap-tab.js"></script>
        <script src="/static/bootstrap/js/bootstrap-tooltip.js"></script>
        <script src="/static/bootstrap/js/bootstrap-popover.js"></script>
        <script src="/static/bootstrap/js/bootstrap-button.js"></script>
        <script src="/static/bootstrap/js/bootstrap-collapse.js"></script>
        <script src="/static/bootstrap/js/bootstrap-carousel.js"></script>
        <script src="/static/bootstrap/js/bootstrap-typeahead.js"></script>

        <script type="text/javascript">
            var urls = {};
            var Anywhere = {};
            Anywhere.urls = {};
        </script>
        <script type="text/javascript" src="/static/anywhere/scripts/ajax_utils.js"></script>

        <script type="text/javascript" src="/static/anywhere/scripts/feedback_dialog.js"></script>
        
        <script type="text/javascript">
            $(function() {
                $.extend(
                    urls,
                    {
                        feedback: '/feedback/submit/'
                    }
                );
                
                    Anywhere.FeedbackDialog.Initialise(urls, false);
                
            });
        </script>

        <script type="text/javascript">

            var _gaq = _gaq || [];
            _gaq.push(['_setAccount', 'UA-18014859-6']);
            _gaq.push(['_trackPageview']);

            (function() {
                var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
                ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
            })();

        </script>

        



    </body>
</html>
